import React, { useContext } from 'react';
import Icon from '/@/components/icon';
import GlobalContext from '../../GlobalContext';
export default function Menushrink(props: { color?: string }) {
  const { color = 'var(--squidwest-color-fontsizecolor)' } = props;
  const { collapsed, shrinkFun } = useContext(GlobalContext);
  return (
    <Icon
      onClick={() => {
        shrinkFun && shrinkFun();
      }}
      icon={collapsed ? 'MenuUnfoldOutlined' : 'MenuFoldOutlined'}
      style={{ color, cursor: 'pointer' }}
    />
  );
}
